package dyy.zc.computergradeexam;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;


public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private TextView tvXuanZe, tvTianKong, tvBianCheng;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        initView();

    }

    private void initView() {
        tvXuanZe = (TextView) findViewById(R.id.tv_XuanZe);
        tvTianKong = (TextView) findViewById(R.id.tv_TianKong);
        tvBianCheng = (TextView) findViewById(R.id.tv_BianCheng);


        tvXuanZe.setOnClickListener(this);
        tvTianKong.setOnClickListener(this);
        tvBianCheng.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_XuanZe:
                Intent intent = new Intent(MainActivity.this, XuanZeActivity.class);
                startActivity(intent);
                break;
            case R.id.tv_TianKong:
                Intent intent1 = new Intent(MainActivity.this, TianKongActivity.class);
                startActivity(intent1);
                break;
            case R.id.tv_BianCheng:
                Intent intent2 = new Intent(MainActivity.this, BianChengActivity.class);
                startActivity(intent2);
                break;

        }

    }
}
